<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {:widget_st('layui','css')}
  {:widget_st('jq','js')}
  {:widget_st('layui','js')} 
</head>
{:do_action('admin_head')}
<body>
  <?php $form_widget = new \app\common\widget\FormPro();  ?>
  <div class="layui-form"  style="padding: 20px 0 0 0;">
    <form class="info_tj" onclick="return false">
      <!-- <input type="hidden" name="id" value="{$res.id}">
      <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
          <input type="password" name="pwd" lay-verify="required" placeholder="请输入用密码" autocomplete="off" class="layui-input">
        </div>
      </div> -->
      <div class="layui-col-sm12">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-sm6">
              <div class="layui-card">
                <input type="hidden" name="id" value="{$res.id}">
                {$form_widget->form_input(['title'=>'新密码','name'=>'pwd','data'=>'','type'=>'password','theme'=>1])|raw}
              </div>
            </div>
        </div>
      </div>

      {include file="public/widget_submit"}
      
    </form>
  </div>
  <script>
 layui.use(['form', 'upload'], function(){
    var $ = layui.$
    ,form = layui.form
    ,upload = layui.upload ;

    $(".tijiao").on("click",function(){
      var data = $(".info_tj input").serialize();      
      $.ajax({
          type:'post',
          url:"{:url('admin/user/pwd_edit')}",
          data:data,
          dataType:'json',
          success:function(res){
            // console.log(res)
            if(res.result==1){
              layer.msg("修改成功,请重新登陆", {icon: 1});
              setTimeout(function() {
                window.parent.location.reload();
              }, 2000);
            }else{
              layer.msg(res.msg, {icon: 2});
              setTimeout(function() {
                window.parent.location.reload();
              }, 2000);
            }
            
          }
      })

    })
    
    
  })
  </script>
</body>
</html>
{:do_action('admin_js')}